//封装本地存储存储数据与读取数据方法
//存储数据
export const SET_TOKEN = (token: string) => {
    localStorage.setItem('Token', token)
}
//本地存储获取数据
export const GET_TOKEN = () => {
    return localStorage.getItem('Token')
}
//本地存储删除数据方法
export const REMOVE_TOKEN = () => {
    localStorage.removeItem('Token')
}

export const SET_ROUTES = (routes: string[]) => {
    localStorage.setItem('Routes', JSON.stringify(routes))
}

export const GET_ROUTES = () => {
    return localStorage.getItem('Routes')
}

export const REMOVE_ROUTES = () => {
    localStorage.removeItem('Routes')
}

export const SET_BUTTONS = (buttons: string[]) => {
    localStorage.setItem('Buttons', JSON.stringify(buttons))
}

export const GET_BUTTONS = () => {
    return localStorage.getItem('Buttons')
}

export const REMOVE_BUTTONS = () => {
    localStorage.removeItem('Buttons')
}

export const setLocalStorage = (key: string, value: string) => {
    localStorage.setItem(key, value)
}

export const getLocalStorage = (key: string) => {
    return localStorage.getItem(key)
}

export const removeLocalStorage = (key: string) => {
    localStorage.removeItem(key)
}

